package com.github.thinwonton.assembly.web.controller;

import com.github.thinwonton.assembly.entity.Ticket;
import com.github.thinwonton.assembly.service.TicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by hugo on 2017/6/15.
 */
@Controller
@RequestMapping("/ticket")
public class TicketController {
    @Autowired
    private TicketService ticketService;

    @RequestMapping("/list")
    @ResponseBody
    public List<Ticket> listTickets() {
        return ticketService.list();
    }
}
